package com.come4loves.game.module.fight.action;

import com.come4loves.game.module.battle.helper.PBConvertHelper;
import com.come4loves.game.module.fight.model.FightCard;
import com.come4loves.game.proto.BattleProto;
import com.google.protobuf.GeneratedMessage.Builder;

public class ChangeUnitAction extends Action {
	private FightCard fightCard;
	public ChangeUnitAction(FightCard fightCard) {
		super(fightCard.getId());
		this.fightCard = fightCard;
	}


	@Override
	public Builder<?> toProtocolBufferBuilder() {
		BattleProto.ChangeUnitAction.Builder builder = BattleProto.ChangeUnitAction.newBuilder();
		builder.setChangeCard(PBConvertHelper.fightCard2CardsInfo(fightCard, true, null));
		return builder;
	}

}
